<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />

		<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
		Remove this if you use the .htaccess -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

		<title>form</title>
		<meta name="description" content="" />
		<meta name="author" content="Administrator" />

		<meta name="viewport" content="width=device-width; initial-scale=1.0" />

		<style>
			img {
				width: 100px;
				height: 100px;
			}
			#filedrag {
				display: none;
				font-weight: bold;
				text-align: center;
				padding: 1em 0;
				margin: 1em 0;
				color: #555;
				border: 2px dashed #555;
				border-radius: 7px;
				cursor: default;
			}
			#filedrag.hover {
				color: #f00;
				border-color: #f00;
				border-style: solid;
				box-shadow: inset 0 3px 4px #888;
			}
			#progress p {
				display: block;
				width: 240px;
				padding: 2px 5px;
				margin: 2px 0;
				border: 1px inset #446;
				border-radius: 5px;
			}

		</style>

	</head>

	<body>
		<div>
			<header>
				<h1>form</h1>
			</header>
			<nav>
				<p>
					<a href="/">Home</a>
				</p>
				<p>
					<a href="/contact">Contact</a>
				</p>
			</nav>

			<div>
				<form id="upload" action="upload.php" method="POST" enctype="multipart/form-data">
					<fieldset>
						<legend>
							HTML File Upload
						</legend>
						<input type="hidden" id="MAX_FILE_SIZE" name="MAX_FILE_SIZE" value="300000" />
						<div>
							<label for="fileselect">Files to upload:</label>
							<input type="file" id="fileselect" name="fileselect[]" multiple="multiple" />
							<div id="filedrag">
								<?php
								if ($handle = opendir('uploads')) {
									/* This is the correct way to loop over the directory. */
									while (false !== ($entry = readdir($handle))) {

										echo '<img src="http://localhost/album/uploads/' . $entry . '" />';
									}
									closedir($handle);
								}
								?>
							</div>
						</div>
						<div id="submitbutton">
							<button type="submit">
								Upload Files
							</button>
						</div>
					</fieldset>
				</form>
				<div id="messages">
					<p>
						Status Messages
					</p>
				</div>
			</div>

			<footer>
				<p>
					&copy; Copyright  by Léon
				</p>
				<script type="text/javascript" src="drag.js"></script>
			</footer>
		</div>
	</body>
</html>
